import os

class Config:
    URL="http://127.0.0.1:5000/api/"
    SQLALCHEMY_DATABASE_URI = "mysql+mysqlconnector://kj:123456@127.0.0.1:3306/kj"
    # 示例：mysql+mysqlconnector://root:password@127.0.0.1:3306/mydatabase
    UPLOAD_FOLDER = './upload/img/'
    # 允许的文件扩展名
    ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg'}
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SQLALCHEMY_ENGINE_OPTIONS = {
        'pool_pre_ping': True,
        'pool_size': 10,
        'max_overflow': 20,
    }
    # MySQL连接池配置
    mysql_config = {
        'host': '127.0.0.1',  
        'user': 'kj',             
        'password': '123456',     
        'database': 'kj'          
    }

    # Redis连接配置
    redis_config = {
        'host': '127.0.0.1',
        'port': 6379,
        'db': 0
    }
